package InputCheck;

import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 28318
 * Date: 2025-10-28
 * Time: 21:21
 */
public class InputCheck {
    public static int ExceptionCheck(){
        Scanner inPut = new Scanner(System.in);
        String numCheck = inPut.nextLine();
        char[] charCheck = new char[]{'0','1','2','3','4','5','6','7','8','9','0'};
        for (int i = 0; i < numCheck.length(); i++) {
            int exception = -1;
            for(char check : charCheck){
                if (numCheck.charAt(i) == check){
                    exception++;
                }
            }
            if (exception < 0){
                return -1;
            }
        }
        return Integer.parseInt(numCheck);
    }
}
